﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace AuthorInqury//这个是首页，也就是登录页面.父窗体
{
    public class Register
    {
        private Register1 register1 = new Register1();//实例化
        private AuthorRegister authorRegister = new AuthorRegister();//实例化
        private Authorinqury authorinqury = new Authorinqury();//实例化
    }
    public partial class AuthorRegister : Form
    {
        

        public AuthorRegister()
        {
            InitializeComponent();
        }
        public void SetInfo(string info)
        {
            //设置如下文本框
            this.textBox1.Text = info;//需要双重调用
            this.textBox2.Text = info;//
        }
        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            //无视
        }

        private void button1_Click(object sender, EventArgs e)//登录按钮，事件触发

        {
            //获取用户输入的账号
            string userName = this.textBox1.Text.Trim();
            //获取用户输入的密码
            string pwd = this.textBox2.Text.Trim();
            if (textBox1.Text.Trim() == "何嘉滨滨滨滨"&&textBox2.Text.Trim()=="123456")//判断全等于
            {
                MessageBox.Show("登录成功！");
                
            }
            this.Close();
            Authorinqury authorinqury = new Authorinqury();
            authorinqury.Show();
            Add insert = new Add();
            insert.Owner = this;
            insert.Show();

        }

        private void button2_Click(object sender, EventArgs e)//注册按钮，事件触发
        {
            
            //首页注册的页面跳转到副业面的注册页面当中
            Register1 register1 = new Register1();     //打星号
            register1.Show();//实例显示                //打星号
        }

        private void button3_Click(object sender, EventArgs e)//退出按钮事件触发
        {//触发枚举事件，询问用户是否要退出注册页面
            DialogResult DR = MessageBox.Show("是否退出注册页面","退出",MessageBoxButtons.YesNo,MessageBoxIcon.Question);
            if(DR==DialogResult.Yes)
            {
                
                Application.Exit();
            }
        }
    }
}
